package com.example.core.utils

/**
 * Created by zhudongao
 * Desc
 * Date 2020/11/8
 */
object FastClickUtil {
    /**
     * Prevent continuous click, jump two pages
     */
    private var lastClickTime: Long = 0
    private const val duration: Long = 500

    fun isFastDoubleClick(): Boolean {
        val time = System.currentTimeMillis()
        if (time - lastClickTime < duration) {
            return true
        }
        lastClickTime = time
        return false
    }
}